package cn.wolfcode.cloud.shop.resp;

import lombok.Getter;
import lombok.Setter;

import java.text.MessageFormat;

/**
 * @author Administrator
 */
@Getter
@Setter
public class MemberServerCodeMsg extends CodeMsg {

    public static final MemberServerCodeMsg USERNAME_OR_PASSWORD_ERROR = new MemberServerCodeMsg(600010001,"用户名或者密码错误");

    public static final MemberServerCodeMsg ARGUMENTS_ERROR = new MemberServerCodeMsg(60001400,"参数异常:{0}");

    public MemberServerCodeMsg(Integer code,String msg){
        super(code,msg);
    }

    public MemberServerCodeMsg fillArgs(String realMsg){
        return new MemberServerCodeMsg(this.getCode(), MessageFormat.format(this.getMsg(),realMsg));
    }
}
